package com.pd.backend.enums;

/**
 * 消息常量
 */
public enum AppHttpCodeEnum {

    // 成功段0
    SUCCESS(200,"操作成功"),
    // 登录段1~50
    NEED_LOGIN(1,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(2,"密码错误"),
    USER_STATUS_EX(3,"用户状态异常"),
    LOGIN_CODE_EX(4,"验证码异常"),
    LOGIN_CODE_ERROR(5,"验证码错误"),
    USER_NOT_EXISTS(6, "用户不存在"),
    // 参数错误 500~1000
    PARAM_REQUIRE(500,"缺少参数"),
    PARAM_INVALID(501,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(502,"图片格式有误"),
    SERVER_ERROR(503,"服务器内部错误"),
    PARAM_NOT_EMPTY(504,"不能为空"),
    // 数据错误 1000~2000
    DATA_EXIST(1000,"数据已经存在"),
    AP_USER_DATA_NOT_EXIST(1001,"ApUser数据不存在"),
    DATA_NOT_EXIST(1002,"数据不存在"),
    DATE_INSERT_ERROR(1004,"新增失败"),
    DATE_UPDATE_ERROR(1005,"修改失败"),
    DATE_STATUS_EX(1006,"请修改状态后再删除"),
    DATE_DELETE_ERROR(1007,"删除失败"),
    DATA_STATUS_EX(1003,"数据状态异常"),
    // 数据错误 3000~3500
    NO_OPERATOR_AUTH(3000,"无权限操作"),
    NEED_ADMIND(3001,"需要管理员权限");

    int code;
    String errorMessage;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.errorMessage = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}
